{{#if bus_info.config.home_imgs.length}}
<picwall array-data-key="bus_info.config.home_imgs"></picwall>
{{/if}}
<div class="main">
	<div class="title">
		<div class="tile"></div>
		新品推荐
	</div>
	{{#each goods_list}}
	<goodsbox
		src="{{preview_img_url}}?imageView/1/w/200/h/200"
		href="#default/detail?id={{_id}}"
		name="{{goods_name}}"	
		price="{{price}}"
	></goodsbox>
	{{/each}}
</div>


<xmp type="tag" name="goodsbox">
	<div class="goodsbox">
		<a href="${href}">
			<img bind-src="${src}" />
		</a>  
		<div class="info">
			<div class="name">
				<a href="${href}">
					${name}
				</a>
			</div>
		</div>
		<div class="price">
			￥<span>${price}</span>
		</div>
		<button event-click="{{'$Top.$Event.goods_list.add_to_cart'}}">
			加入购物车
		</button>
	</div>
</xmp>

<xmp type="tag" name="picwall">
    <div class="picwall">
        <div class="carosule">
            <div class="pic-show">
                {{#each ${array-data-key} }}
                <div style="z-index:{{$Parent.length-$Index}}" class="pic">
                    <a target="_blank" bind-href="{{href||'javascript:void 0'}}">
                        <img bind-src="{{img_url}}" bind-title="{{title}}" />
                    </a>
                </div>
                {{/each}}
            </div>
        </div>
    </div>
    <script type="text/vm">
        function(vm) {
            var picwall = vm.queryElement({
                className: 'picwall'
            })[0];
            var img = vm.queryElement({
                tagName: "IMG"
            });
            require(["jQuery"], function($) {
                var w = $(picwall).width();
                $(picwall).height(w * 0.2841);
                var current_pic;
                var pics = $(".pic");
                var len=$(pics).length;
                if (len>1) {
                    var i=1;
                    var timer = setInterval(function() {
                        $(pics[i%len]).fadeIn(800);
                        $(pics[(i-1)%len]).fadeOut(800);
                        i+=1;
                    }, 5000);
                };
            });
        }
    </script>
</xmp>